class getShare {
	//提交指定用户的分享
	CUserShare(userid) {
		console.log(userid)
		return {
			userId: userid,
			pageSize: 20,
			pageIndex: 1
		}
	}
	//获取我的收藏
	DUsercollect(ablumArr) {
		let arr = [];
		ablumArr.forEach(ablum => {
			let newablum = {
				shareId: ablum.shareId,
				ablumCoverPath: ablum.ablumCoverPath,
				ablumDescription: ablum.ablumDescription,
				collectionId:ablum.collectionId,
				userId:ablum.userId,
				userCoverPath:ablum.userCoverPath,
				ablumName:ablum.ablumName
			}
			arr.push(newablum)
		})
		return arr
	}
	//收到指定用户的分享
	DUserShare(ablumArr) {
		let arr = [];
		ablumArr.forEach(ablum => {
			let newablum = {
				shareId: ablum.shareId,
				shareCoverPath: ablum.shareCoverPath,
				pictureCount: ablum.pictureCount,
				sharedTime: ablum.sharedTime,
				updateTime: ablum.updateTime,
				likesCount: ablum.likesCount,
				reviewsCount: ablum.reviewsCount,
				colloctionsCount: ablum.colloctionsCount,
				userId: ablum.userId,
				userName: ablum.userName,
				userCoverPath: ablum.userCoverPath,
				isLiked: ablum.isLiked,
				isColloctd: ablum.isColloctd,
				shareName:ablum.shareName
			}
			arr.push(newablum)
		})
		return arr
	}

	//提交	广场中的数据
	Csquare(page) {
		return {
			pageSize: 20,
			pageIndex: page
		}
	}

	//获取广场中的数据
	Dsquare(ablumArr) {
		let arr = [];
		ablumArr.forEach(ablum => {
			let newablum = {
				shareId: ablum.shareId,
				shareCoverPath: ablum.shareCoverPath,
				pictureCount: ablum.pictureCount,
				sharedTime: ablum.sharedTime,
				updateTime: ablum.updateTime,
				likesCount: ablum.likesCount,
				reviewsCount: ablum.reviewsCount,
				colloctionsCount: ablum.colloctionsCount,
				userId: ablum.userId,
				userName: ablum.userName,
				userCoverPath: ablum.userCoverPath,
				isLiked: ablum.isLiked,
				isColloctd: ablum.isColloctd,
				isfollow:ablum.isFollowed,
				ablumName:ablum.shareName
			}
			arr.push(newablum)
		})
		return arr
	}

	//获取分享的照片
	Dimages(images) {
		let photoArr = []
		images.forEach(image => {
			let newimgage = {
				pictureId: image.pictureId,
				picturePath: image.picturePath
			}
			photoArr.push(newimgage)
		})
		return photoArr
	}

	//广场点赞
	CsquareLikes(shareId) {
		return {
			// 必填
			"Method": "LIKE",
			"ShareId": shareId
		}
	}
	//广场取消点赞
	CsquareUnlikes(sharId) {
		return {
			// 必填
			"Method": "NOTLIKE",
			"ShareId": sharId
		}
	}
	//广场收藏
	CsquareColloct(shareid) {
		return {
			"Method": "COLLECT",
			"ShareId": shareid
		}
	}
	//取消收藏
	CsquareUnColloct(shareid) {
		return {
			"Method": "NOTCOLLECT",
			"ShareId": shareid
		}
	}
	//获取关注列表
	Duserfollow(res){
		let newData = [];
		res.forEach(item=>{
			let newObj = {
				followId:item.followId,
				followTime: item.followTime,
				userName:item.userName,
				userCoverPath:item.userCoverPath
			}
			newData.push(newObj)
		})
		return newData
	}
	
}


export default getShare
